package com.java202411.contoller.user;


import com.java202411.contoller.user.request.CreateUserRequest;
import com.java202411.entity.UserEntity;
import com.java202411.service.user.UserService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequiredArgsConstructor
public class UserController {

    private final UserService userService;

    @PostMapping("/users")
    public UserEntity createUser(@RequestBody CreateUserRequest request) {
        return userService.createUser(request.getEmail(), request.getPassword());
    }
}
